package com.itheima.kafka.boot;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private KafkaTemplate kafkaTemplate;


    @GetMapping("hello")
    public String hello(){
        kafkaTemplate.send("kafka-hello","黑马程序员");
        return "ok";
    }
}
